package com.google.gwt.sample.dynatablerf.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.sample.dynatablerf.client.home.HomeAppController;
import com.google.gwt.sample.dynatablerf.client.site.SiteAppController;
import com.google.gwt.sample.dynatablerf.client.user.UserAppController;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;

public class DynaTableRf implements EntryPoint {

	private static final String PARAM_MODULE = "module";
	private static final String PARAM_USER_VALUE = "user";
	private static final String PARAM_HOME_VALUE = "home";

	public void onModuleLoad() {

		String module = Window.Location.getParameter(PARAM_MODULE);
		AppController appController = null;
		if (PARAM_USER_VALUE.equals(module)) {
			appController = new UserAppController(RootPanel.get());
		} else if (PARAM_HOME_VALUE.equals(module)) {
			appController = new HomeAppController(RootPanel.get());
		} else {
			appController = new SiteAppController(RootPanel.get());
		}
		appController.start();
	}

}